

public class Mass
{
	// **************
	// Private data
	// **************
	
	private ROI			roi;
	private int			Mass_ID;

	//// Features
	private int			Area;
	private float		Average_Grey;
	private float		Variance_Grey;
	private int			Boundary_Length;
	private float		Sharpness;
	private float		Thinness;

	//// Mass bounding box
	private int			Min_row;
	private int			Min_col;
	private int			Max_row;
	private int			Max_col;

	// **************
	// Methods
	// **************
	
	public Mass(ROI _roi, int mass_id)
	{
		roi = _roi;
		Mass_ID = mass_id;
		Min_row = 9999999; // is there a max-int const?
		Min_col = 9999999; // or should this be initialized to img w/h?
		Max_row = -1;
		Max_col = -1;
		test_init();
	}

	private void test_init()
	{
		Boundary_Length = 100;
		Area = 200;
		Sharpness = 1.0f;
		Average_Grey = 1.0f;
		Variance_Grey = 1.0f;
		Thinness = 1.0f;
	}

	public ROI getROI()
	{
		return roi;
	}

	public int getMassID()
	{
		return Mass_ID;
	}

	public void updateBoundingBox(int x, int y)
	{
		if (x < Min_col)		{ Min_col = x; }
		else if (x > Max_col)	{ Max_col = x; }

		if (y < Min_row)		{ Min_row = y; }
		else if (y > Max_row)	{ Max_row = y; }
	}
	
	public int extract_Area()
	{
		return Area;
	}

	public float extract_AveGrey()
	{
		return Average_Grey;
	}

	public float extract_VarianceGrey()
	{
		return Variance_Grey;
	}

	public int extract_BoundaryLength()
	{
		return Boundary_Length;
	}

	public float extract_Thinness()
	{
		return Thinness;
	}

	public float extract_Sharpness()
	{
		return Sharpness;
	}

	//// Debug stuff
	public void dump_BoundingBox()
	{
		p.print("Min_row: " + Min_row);
		p.print("Min_col: " + Min_col);
		p.print("Max_row: " + Max_row);
		p.print("Max_col: " + Max_col);
	}
}
